package com.gopay.common.cps.dao.bank.impl;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.bank.BisEBankB2BDAO;
import com.gopay.common.domain.bis.BisEbankB2BConfig;

/**
 * 
 * @BisEBankB2BDAOImpl.java
 * @author mz
 * @Jan 6, 2014 8:17:04 PM  www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("bisEBankB2BDAO")
public class BisEBankB2BDAOImpl extends BaseDAOImpl<BisEbankB2BConfig, Serializable>implements BisEBankB2BDAO {

	@Override
	public BisEbankB2BConfig getBisEBankB2BByBankCodeAndInterfaceCode(
			String bankCode, String interfaceCode) {
        Map<String,Object> params = new HashMap<String,Object>();
        params.put("bankCode", bankCode);
        params.put("chCode", interfaceCode);
		List<BisEbankB2BConfig> l = super.findByHql("from BisEbankB2BConfig where del=0 and bankCode=:bankCode and chCode =:chCode ", params);
        return l.size() > 0 ? l.get(0) : null;
	}

	@Override
	public List<BisEbankB2BConfig> getBisEBankB2BByBankCode(String bankCode) {
		 Map<String,Object> params = new HashMap<String,Object>();
	     params.put("bankCode", bankCode);
	     return super.findByHql("from BisEbankB2BConfig where del=0 and bankCode=:bankCode and enable=1 ", params);
	}

}
